package com.jzm.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * DAO公共类
 */
public class BaseDAO {
    /**
     * 依赖connection对象
     */
    public Connection connection;


    /**
     * 依赖statement对象
     */
    public Statement getStatement() throws SQLException {
        return this.connection.createStatement();
    }


    /**
     * 依赖preparestatement对象
     *
     */
    public PreparedStatement getPrepareStatement(String sql) throws SQLException {
        return this.connection.prepareStatement(sql);
    }
}
